﻿using System;

namespace HslCommunication.Core.Address
{
	/// <summary>
	/// 所有设备通信类的地址基础类<br />
	/// Address basic class of all device communication classes
	/// </summary>
	// Token: 0x02000165 RID: 357
	public class DeviceAddressBase
	{
		/// <summary>
		/// 获取或设置起始地址<br />
		/// Get or set the starting address
		/// </summary>
		// Token: 0x17000614 RID: 1556
		// (get) Token: 0x06001DD2 RID: 7634 RVA: 0x0008DE2B File Offset: 0x0008C02B
		// (set) Token: 0x06001DD3 RID: 7635 RVA: 0x0008DE33 File Offset: 0x0008C033
		public ushort Address { get; set; }

		/// <summary>
		/// 解析字符串的地址<br />
		/// Parse the address of the string
		/// </summary>
		/// <param name="address">地址信息</param>
		// Token: 0x06001DD4 RID: 7636 RVA: 0x0008DE3C File Offset: 0x0008C03C
		public virtual void Parse(string address)
		{
			this.Address = ushort.Parse(address);
		}

		/// <inheritdoc />
		// Token: 0x06001DD5 RID: 7637 RVA: 0x0008DE4C File Offset: 0x0008C04C
		public override string ToString()
		{
			return this.Address.ToString();
		}
	}
}
